﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

namespace Dycox.Reporting
{
    public class BackgroundStyle : Style
    {
        public BackgroundStyle()
        {
            
        }

        public Color FillColor
        {
            get { return GetValueOrDefault<Color>("FillColor"); }
            set
            {
                SetValue("FillColor", value);
                if (!value.IsEmpty && FillStyle == Reporting.FillStyle.None)
                    FillStyle = Reporting.FillStyle.Solid;
            }
        }

        public Color AlternativeColor
        {
            get { return GetValueOrDefault<Color>("AlternativeColor"); }
            set { SetValue("AlternativeColor", value); }
        }

        public HatchStyle HatchStyle
        {
            get { return GetValueOrDefault<HatchStyle>("Hatch"); }
            set
            {
                SetValue("Hatch", value);
                if (FillStyle < Reporting.FillStyle.Hatch)
                    FillStyle = Reporting.FillStyle.Hatch;
            }
        }

        public FillStyle FillStyle
        {
            get { return GetValueOrDefault<FillStyle>("FillStyle"); }
            set { SetValue("FillStyle", value); }
        }
    }
}
